/**
 * Copyright (c) Software Institude of PKU
 * All rights reserved. 
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 */
package edu.pku.sei.transformation.editor.actions;

import org.eclipse.jface.action.Action;
import org.eclipse.swt.SWT;

import edu.pku.sei.transformation.editor.model.constraint.Constraint;
import edu.pku.sei.transformation.editor.views.dialogs.ContentDialog;

/**
 * @author fengchao
 * 
 */
public class OpenConstraintDialogAction extends Action {
	private Constraint constraint;

	public OpenConstraintDialogAction(Constraint c) {
		this.setText("open constraint dialog");
		constraint = c;
	}

	@Override
	public void run() {
		ContentDialog d = new ContentDialog();
		d.setDocumentResult(constraint.getContent());
		int result = d.open();
		if (result == SWT.OK) {
			constraint.setContent(d.getDocumentResult());
		} else {

		}
	}
}
